import flyweight.AbstractBox;
import flyweightFactory.BoxFactory;

public class Client {

    public static void main(String[] args) {
        AbstractBox box1 = BoxFactory.getInstance().getShape("I");
        AbstractBox box2 = BoxFactory.getInstance().getShape("L");
        AbstractBox box3 = BoxFactory.getInstance().getShape("O");
        AbstractBox box4 = BoxFactory.getInstance().getShape("O");

        box1.display("黑");
        box2.display("红");
        box3.display("黄");
        box4.display("粉");
        System.out.println("box3和box4是否是同一个对象:" + box3.equals(box4));
    }
}
